/**
 * Text
 * @module text
 * {@link http://www.w3.org/TR/css-text-3/ Specification}
 * =====================================================================================================================
 */

/**
 * Break All
 *
 * @example
 * .break-all();
 */
.break-all() {
    word-break: break-all; // Chrome 4+, Firefox 15+, IE 6+, Safari 3.1+, Opera 15+
}

/**
 * Break Word
 *
 * @example
 * .break-word();
 */
.break-word() {
    word-wrap: break-word; // Chrome 22-4, Firefox 3.5+, IE 6+, Safari 6-3.1, Opera 11.5
    overflow-wrap: break-word; // Chrome 23+, Safari 6.1+, Opera 12.1+
}

/**
 * Hyphens
 *
 * @example
 * .hyphens(auto);
 */
.hyphens(@value: none) {
    -webkit-hyphens: @value; // Safari 5.1+
       -moz-hyphens: @value; // Firefox 6+
        -ms-hyphens: @value; // IE 10+
}

/**
 * Nowrap with Ellipsis
 *
 * @example
 * .nowrap-ellipsis();
 */
.nowrap-ellipsis() {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/**
 * Placeholder
 * {@link https://css-tricks.com/snippets/css/style-placeholder-text/ CSS Tricks}
 *
 * @example
 * .placeholder({ color: #cccccc; font-size: 12px; });
 */
.placeholder(@rules) {
    &::-webkit-input-placeholder { @rules(); } // Chrome 4+, Safari 5+, Opera 15+
             &::-moz-placeholder { @rules(); } // Firefox 19+
              &:-moz-placeholder { @rules(); } // Firefox 18-
         &:-ms-input-placeholder { @rules(); } // IE 10+
}

/**
 * Preformatted text Wrap
 * {@link https://css-tricks.com/snippets/css/make-pre-text-wrap/ CSS Tricks}
 *
 * @example
 * .pre-wrap();
 */
.pre-wrap() {
    white-space: -moz-pre-wrap; // Firefox 4+
    white-space:   -o-pre-wrap; // Opera 12.1-11.5
    white-space:      pre-wrap; // Chrome 21+, Safari 6.1+, Opera 15+
    word-wrap: break-word; // IE 6+
}

/**
 * Text Rendering
 * {@link https://css-tricks.com/almanac/properties/t/text-rendering/ CSS Tricks}
 *
 * @example
 * .text-rendering();
 */
.text-rendering() {
    text-rendering: optimizeLegibility;
}

/**
 * User Select
 * {@link https://css-tricks.com/almanac/properties/u/user-select/ CSS Tricks}
 *
 * @example
 * .user-select();
 */
.user-select(@value: none) {
    -webkit-user-select: @value; // Chrome 6+, Safari 3.1+, Opera 15+
       -moz-user-select: @value; // Firefox 2+
        -ms-user-select: @value; // IE 10+
}